<template>
	<view>

	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		onShow() {
			this.getData()
		},
		methods: {
			getData() {
				const baseUrl = 'https://api-hmugo-web.itheima.net'



				uni.addInterceptor('request', {
					invoke(args) {
						console.log(args);
						args.url = baseUrl + args.url

					},
					success(args) {
						// 请求成功
						console.log('interceptor-success', args)
					},
					fail(err) {
						console.log('interceptor-fail', err)
					},
					complete(res) {
						console.log('interceptor-complete', res)
					}
				})
				uni.request({
					url: '/api/public/v1/home/swiperdata',
					success: (res) => {
						console.log(res.data);
					}
				});
			}
		}
	}
</script>

<style>

</style>
